

<template>
  <div>
    <h1>login</h1>
    <el-button type="primary" @click="login">登录</el-button>
  </div>
</template>
<script setup>
import {useStore} from 'vuex'
import {useRouter} from "vue-router";
const router = useRouter()
const store = useStore()
const login = async ()=> {
  store.commit('set_token', 'token-str');
  router.push('/index')
}
</script>
<style scoped lang="scss">

</style>